import numpy as np
a = np.array([[1], [2], [3]])  # 形状 (3, 1)
b = np.array([10, 20, 30])     # 形状 (3,)
result = a + b  # 广播为 (3, 3)
result2=a*b

print("不同形状数组相加:\n", result)
print("不同形状数组相乘:\n", result2)
# Output:
#     不同形状数组相乘:
#      [[10 20 30]
#      [20 40 60]
#      [30 60 90]]